import { mapGetters } from 'vuex' 
module.exports = {
	data() {
		return {
		}
	},
	computed: {
		...mapGetters([
			'isLogin',
			'user',
			'showLogin'
		])
	},
	methods: {
		checkLogin() {
			return new Promise((resolve, reject) => {
				if (this.isLogin) {
					resolve(true)
				} else {
					this.$store.commit('CHANGE_SETTING', {
						showLogin: true
					})
				}
			})
		}
	},
	onUnload() {
		this.$store.commit('CHANGE_SETTING', {
			showLogin: false
		})
	}
}